import { httpPost, httpGet } from '@/utils/fetch'

export function getUserOpenId(params) {
  return httpGet({
    url: `/applet/user/login?code=${params.code}&StoreId=${params.StoreId}`,
    method: 'get'
  })
}

//小程序静默登录
export function appletLogin(params) {
  return httpGet({
    url: `/rich-sparrow-god/login/appletLogin`,
    method: 'get',
    params
  })
}

// 获取手机号
export function getUserPhone(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/setUserPhone',
    method: 'POST',
    data: params
  })
}

// 管理端-查询所有店铺
export function getAllStore(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/store/getAllStore',
    method: 'POST',
    data: params
  })
}

// 查询店铺下的房间&预约状态
export function getRoomByStoreId(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getRoomByStoreId',
    method: 'POST',
    data: params
  })
}

// 查询店铺详情
export function getStoreDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/store/getStoreDetails',
    method: 'POST',
    data: params
  })
}

// 查询房间详情
export function getRoomDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getRoomDetails',
    method: 'POST',
    data: params
  })
}

// 查询房间的当前时间未来一周的时间占用
export function getRoomWeekTime(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getRoomWeekTime',
    method: 'POST',
    data: params
  })
}

// 预下单
export function saveOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/saveOrder',
    method: 'POST',
    data: params
  })
}

// 新增订单
export function addOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/addOrder',
    method: 'POST',
    data: params
  })
}

// 订单发起支付
export function startPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/startPay',
    method: 'POST',
    data: params
  })
}

// 钱包支付
export function walletPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/walletPay',
    method: 'POST',
    data: params
  })
}

// 查询我的订单分页
export function myOrderPage(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/myOrderPage',
    method: 'POST',
    data: params
  })
}

// 查询订单详情
export function getMyOrderDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getMyOrderDetails',
    method: 'POST',
    data: params
  })
}

// 用户钱包金额
export function getMyWalletAmount(params) {
  return httpPost({
    url: '/rich-sparrow-god/wallet/getMyWalletAmount',
    method: 'POST',
    data: params
  })
}

// 查询充值金额列表
export function getRechargeAmountList(params) {
  return httpPost({
    url: '/rich-sparrow-god/wallet/getRechargeAmountList',
    method: 'POST',
    data: params
  })
}

// 充值
export function recharge(params) {
  return httpPost({
    url: '/rich-sparrow-god/wallet/recharge',
    method: 'POST',
    data: params
  })
}

// 发起支付
export function rechargeStartPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/wallet/rechargeStartPay',
    method: 'POST',
    data: params
  })
}

// 查询问题反馈选项
export function getFeedbackOptionsList(params) {
  return httpPost({
    url: '/rich-sparrow-god/userProblemFeedback/getFeedbackOptionsList',
    method: 'POST',
    data: params
  })
}

// 用户提交问题反馈
export function addProblemFeedback(params) {
  return httpPost({
    url: '/rich-sparrow-god/userProblemFeedback/addProblemFeedback',
    method: 'POST',
    data: params
  })
}

// 通过订单id开锁
export function orderUnLock(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/orderUnLock',
    method: 'POST',
    data: params
  })
}

// 手动取消订单
export function cancelMyOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/cancelMyOrder',
    method: 'POST',
    data: params
  })
}

// 提前结束订单
export function endUse(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/endUse',
    method: 'POST',
    data: params
  })
}

// 续单前验证
export function reorderVerify(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/reorderVerify',
    method: 'POST',
    data: params
  })
}

// 续单
export function reorder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/reorder',
    method: 'POST',
    data: params
  })
}

// 提前取消发起退款
export function startBack(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/startBack',
    method: 'POST',
    data: params
  })
}

// 根据订单查询可用优惠券
export function getUserCouponByOrderPage(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getUserCouponByOrderPage',
    method: 'POST',
    data: params
  })
}

// 订单绑定优惠券
export function orderBindCoupon(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/orderBindCoupon',
    method: 'POST',
    data: params
  })
}

// 提前入场
export function earlyEntry(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/earlyEntry',
    method: 'POST',
    data: params
  })
}

// 分页查询我的优惠券
export function getUserCouponPage(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/getUserCouponPage',
    method: 'POST',
    data: params
  })
}

// 提前入场订单
export function entryJudge(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/entryJudge',
    method: 'POST',
    data: params
  })
}

// 根据店铺id分页查询房间
export function getRoomPageByStoreId(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/getRoomPageByStoreId',
    method: 'POST',
    data: params
  })
}

// 修改房间状态
export function stopOrStartRoom(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/stopOrStartRoom',
    method: 'POST',
    data: params
  })
}

// 管理员开房间门
export function openRoomDoor(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/openRoomDoor',
    method: 'POST',
    data: params
  })
}

// 管理员开续电器
export function openRelays(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/openRelays',
    method: 'POST',
    data: params
  })
}

// 管理员关续电器
export function closeRelays(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/closeRelays',
    method: 'POST',
    data: params
  })
}

// 查询平台协议
export function getPlatformAgreement(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/store/getPlatformAgreement',
    method: 'POST',
    data: params
  })
}

// 支付成功订单信息
export function getPaySuccessOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getPaySuccessOrder',
    method: 'POST',
    data: params
  })
}

// 用户是否已同意协议
export function getUserAgreement(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/getUserAgreement',
    method: 'POST',
    data: params
  })
}

// 用户同意协议
export function addUserAgreement(params) {
  return httpPost({
    url: '/rich-sparrow-god/appletUser/addUserAgreement',
    method: 'POST',
    data: params
  })
}

// 开大门锁
export function unStoreLock(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/unStoreLock',
    method: 'POST',
    data: params
  })
}

// 查询预下单
export function getFakeOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getFakeOrder',
    method: 'POST',
    data: params
  })
}

// 编辑预下单
export function updateFakeOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/updateFakeOrder',
    method: 'POST',
    data: params
  })
}

// 打扫完成
export function cleanFinish(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/cleanFinish',
    method: 'POST',
    data: params
  })
}

// 默认取消订单
export function defaultCancelOrder(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/defaultCancelOrder',
    method: 'POST',
    data: params
  })
}

// 提前入场验证
export function earlyEntryVerify(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/earlyEntryVerify',
    method: 'POST',
    data: params
  })
}

// 查询续单详情
export function getReorderDetails(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/getReorderDetails',
    method: 'POST',
    data: params
  })
}

// 续单钱包支付
export function reorderWalletPay(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/reorderWalletPay',
    method: 'POST',
    data: params
  })
}

// 卷码校验
export function receiptCheckout(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/receiptCheckout',
    method: 'POST',
    data: params
  })
}

// 验劵下单时间段验证
export function checkoutOrderTime(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/checkoutOrderTime',
    method: 'POST',
    data: params
  })
}

// 验劵下单
export function checkTheStock(params) {
  return httpPost({
    url: '/rich-sparrow-god/myorder/checkTheStock',
    method: 'POST',
    data: params
  })
}

// 管理员开大门
export function openStoreDoor(params) {
  return httpPost({
    url: '/rich-sparrow-god/applet/room/openStoreDoor',
    method: 'POST',
    data: params
  })
}